﻿// -------------------------------------------------------------------------
//    @FileName         :    NFBuffPart.cpp
//    @Author           :    gaoyi
//    @Date             :    24-8-29
//    @Email            :    445267987@qq.com
//    @Module           :    NFBuffPart
//
// -------------------------------------------------------------------------

#include "NFBuffPart.h"

#include "proto_cs_login.pb.h"
#include "proto_db.pb.h"

NFBuffPart::NFBuffPart()
{
    if (EN_OBJ_MODE_INIT == NFShmMgr::Instance()->GetCreateMode())
    {
        CreateInit();
    }
    else
    {
        ResumeInit();
    }
}

NFBuffPart::~NFBuffPart()
{
}

int NFBuffPart::CreateInit()
{
    return 0;
}
    
int NFBuffPart::ResumeInit()
{
    return 0;
}

int NFBuffPart::LoadFromDB(const proto_ff::tbRoleDetail *pDBData)
{
    return 0;
}

int NFBuffPart::InitConfig(proto_ff::tbRoleDetail *pDbData, const RoleOne &stRoleOne)
{
    m_stData.FromPb(pDbData->role_play_data().state_data());
    return 0;
}

int NFBuffPart::SaveDB(proto_ff::tbRoleDetail *pDBData)
{
    m_stData.ToPb(pDBData->mutable_role_play_data()->mutable_state_data());
    return 0;
}

int NFBuffPart::MakePlayerDataCS(proto_ff::Proto_CSGetRoleRsp* pCSGetRoleRsp)
{
    m_stData.ToPb(pCSGetRoleRsp->mutable_state_data());
    return 0;
}

int NFBuffPart::MakeCityPlayerData(proto_ff::CityRoleInfo* pGCCityRoleInfo)
{
    return 0;
}
